package fr.univ.context.data.entity;

import android.content.ContentValues;
import fr.univ.context.data.handler.EntityBase;
import fr.univ.context.data.table.PositionTable;

/**
 * @Entity
 * @Table (name = "position")*/

public class Position extends EntityBase {
	
	/**
	 * @Column (name = "latitude")*/
	private double latitude;
	
	/**
	 * @Column (name = "longitude")*/
	private double longitude;
	
	/**
	 * @Column (name = "address")*/
	private String address;
	
	
	public Position(double latitude, double longitude, String address, String completeDate){
		super(completeDate);
		this.latitude = latitude;
		this.longitude = longitude;
		this.address = address;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Override
	/**
	 * Get ContentValues
	 * @return Object ContentValues with the values of this entity.*/
	public ContentValues getContentValues() {
		
		ContentValues cv = new ContentValues();
		
		cv.put(PositionTable.COLUMNS[1], getLatitude());
		cv.put(PositionTable.COLUMNS[2], getLongitude());
		cv.put(PositionTable.COLUMNS[3], getAddress());
		cv.put(PositionTable.COLUMNS[4], getCompleteDate());
		
		return cv;
	}
}
